node('mdm') {
    stage('download and copy ip2region db') {
//        sh 'rm -f /data/wangwei/ip2region.db'
//        sh 'wget -O /data/lib/ip2region.db https://gitee.com/lionsoul/ip2region/raw/master/data/ip2region.db'
        checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[url: 'https://gitee.com/lionsoul/ip2region.git']]])

//        archiveArtifacts 'data/ip2region.db'
        dir('data') {
            sh 'cp ip2region.db /data/lib1'
        }
    }

//    stage('refresh db') {
//        sh 'curl -X PUT http://10.1.23.147:8081/master/v1/areas/locate/ip/db/refresh'
//    }
}

//node('mdm') {
//    copyArtifacts(projectName: 'refresh-ip2region-db');
//
//    stage('copy ip2region db') {
//        sh 'cp data/ip2region.db /data'
//    }
//}